|
|
|
|
|
|
|
are prompted to confirm the OCX name (keep CUSTOMVALIDATION.OCX) and, after you click OK, Visual Basic 5 creates a complete ActiveX control for your use. You use this control in the next, and final, section when you build the CompanyMaster form. |
|
|
|
|
|
|
|
|
After creating the OCX, save the project group. This might also be a good time to take a short break before you move on to the last section of the chapter. |
|
|
|
|
|
|
|
|
Building the CompanyMaster Input Form |
|
|
|
|
|
|
|
|
Because you learned about data controls and form design in Day 4, ''Creating Data Entry Forms with Bound Controls," and developed an ActiveX control to handle input validation in the first part of today's lesson, you are ready to design the first data entry form for the CompanyMaster data table. |
|
|
|
|
|
|
|
|
Following are the four basic steps to coding data entry forms in Visual Basic 5: |
|
|
|
|
|
|
|
|
· Place input controls and prompts. |
|
|
|
|
|
|
|
|
· Add and code command buttons. |
|
|
|
|
|
|
|
|
You can use these steps in coding any forms for Visual Basic 5. You follow these steps while you construct the CompanyMaster data entry form. |
|
|
|
|
|
|
|
|
The first step is to set the size of the data entry form, add the input palette, and add any frames needed. These are the basic components of the form. All other controls are placed upon the palette within the frames you install in this step. |
|
|
|
|
| |
|
|
|
|
If you put the palette and frames up first, you can place all other controls as so-called children of the palette and frames. This way, when you move the frame, all controls within that frame also move. The same thing happens when you move the large palette. Creating forms this way makes it easy to make slight adjustments later. |
|
|
|
|
|
|
|
|
|
|
At this time, you also add the data control and the final exit button to the form. Use the information in Table 5.1 and Figure 5.19 as a guide for sizing and placing the basic form components. |
|
|
|
|
|